package com.mobileares.midp.widgets.client.textbox2;

import com.google.gwt.user.client.ui.Widget;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Tom
 * Date: 2011-11-24
 * Time: 9:21:15
 * To change this template use File | Settings | File Templates.
 */
public class LabelProvider {
    private Widget widget;
    private String id;
    private List<ILabelValidator> validators;
    private IFormElementProvider provider;

    public LabelProvider(IFormElementProvider provider) {
        this.provider = provider;
    }

    public IFormElementProvider getProvider() {
        return provider;
    }

    public void setProvider(IFormElementProvider provider) {
        this.provider = provider;
    }

    public Widget getWidget() {
        return widget;
    }

    public void setWidget(Widget widget) {
        this.widget = widget;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public List<ILabelValidator> getValidators() {
        return validators;
    }

    public void addValidators(ILabelValidator validator) {
        if (validators == null) validators = new ArrayList<ILabelValidator>();
        this.validators.add(validator);
    }
}
